//
//  NSDictionary+FASafe.m
//  FASafeCategory
//
//  Created by yicheng wu on 16/8/3.
//  Copyright © 2016年 wicheng@163.com. All rights reserved.
//

#import "NSDictionary+FASafe.h"


@implementation NSDictionary (FASafe)

- (id)fa_objectForKeySafe:(id)aKey{
    if (!aKey) {
        NSLog(@"nil aKey %@",NSStringFromSelector(_cmd));
        return nil;
    }
    return [self objectForKey:aKey];
}

@end

@implementation NSMutableDictionary (FASafe)

- (void)fa_setObjectSafe:(id)anObject forKey:(id<NSCopying>)aKey {
    
    if (!aKey) {
        NSLog(@"nil aKey %@",NSStringFromSelector(_cmd));
        return;
    }
    if (!anObject){
        NSLog(@"nil aKey %@",NSStringFromSelector(_cmd));
        return;
    }
    
    return [self setObject:anObject forKey:aKey];
}

@end
